package com.yishusmt.wechatapi.wechatdev.serviceImpl;

import com.yishusmt.wechatapi.wechatdev.entity.WechatMemebrEntity;
import com.yishusmt.wechatapi.wechatdev.mapper.WechatMemebrEntityMapper;
import com.yishusmt.wechatapi.wechatdev.service.AsyncTaskService;
import com.yishusmt.wechatapi.wechatdev.utils.UserUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author zhangyi
 * @date 2018/8/31 15:41
 */
@Slf4j
@Service
public class AsyncTaskServiceImpl implements AsyncTaskService {

    @Autowired
    private WechatMemebrEntityMapper wechatMemebrEntityMapper;

    /**
     * 保存用户
     */
    @Override
    public boolean saveUser(WechatMemebrEntity wechatMemebrEntity){
        int i = wechatMemebrEntityMapper.insertSelective(wechatMemebrEntity);
        if(0 == i){
            log.error("保存用户失败::用户{}",wechatMemebrEntity.toString());
            return false;
        }else {
            log.info("保存用户成功:: 用户{}",wechatMemebrEntity.toString());
            return true;
        }
    }
    /**
     * 更新用户
     */
    @Override
    public void updateUser(WechatMemebrEntity wechatMemebrEntity) {
        //更新用户
    }
}
